package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;


/**
 * 生产工单表
 * @TableName pro_workorder
 */
@TableName(value ="pro_workorder")
@Data
public class ProWorkorder implements Serializable {
    /**
     * 工单ID
     */
    @TableId(type = IdType.AUTO)
    private Integer workorderId;

    /**
     * 工单编码
     */
    private String workorderCode;

    /**
     * 工单名称
     */
    private String workorderName;

    /**
     * 客户订单id
     */
    private Integer clientOrderId;

    /**
     * 订单编码
     */
    private String clientOrderCode;

    /**
     * 来源类型
     */
    private String orderSource;

    /**
     * 来源单据
     */
    private String sourceCode;

    /**
     * 产品ID
     */
    private Integer productId;

    /**
     * 产品编号
     */
    private String productCode;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 规格型号
     */
    private String productSpc;

    /**
     * 单位
     */
    private String unitOfMeasure;

    /**
     * 生产数量
     */
    private Integer quantity;

    /**
     * 已生产数量
     */
    private Integer quantityProduced;

    /**
     * 调整数量
     */
    private Integer quantityChanged;

    /**
     * 已排产数量
     */
    private Integer quantityScheduled;

    /**
     * 客户ID
     */
    private Integer clientId;

    /**
     * 客户编码
     */
    private String clientCode;

    /**
     * 客户名称
     */
    private String clientName;

    /**
     * 需求日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date requestDate;

    /**
     * 父工单
     */
    private Integer parentId;

    /**
     * 所有父节点ID
     */
    private String ancestors;

    /**
     * 单据状态
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 预留字段1
     */
    private String attr1;

    /**
     * 预留字段2
     */
    private String attr2;

    /**
     * 预留字段3
     */
    private Integer attr3;

    /**
     * 预留字段4
     */
    private Integer attr4;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 
     */
    private String batchCode;

    /**
     * 完成时间
     */
    private Date finishDate;

    /**
     * 工单类型
     */
    private String workorderType;

    /**
     * 
     */
    private Long vendorId;

    /**
     * 
     */
    private String vendorCode;

    /**
     * 
     */
    private String vendorName;

    /**
     * 创建人id
     */
    private Long createUserId;

    /**
     * 更新人id
     */
    private Long updateUserId;

    /**
     * 逻辑删除字段 0:未删除 1:已删除
     */
    private Integer deleted;

    /**
     * 逻辑删除辅助字段
     */
    private Date deleteat;

    /**
     * 乐观锁
     */
    private Integer version;

    /**
     * 
     */
    private Integer 列Name;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    @TableField(exist = false)
    private List<ProWorkorder> Children;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProWorkorder other = (ProWorkorder) that;
        return (this.getWorkorderId() == null ? other.getWorkorderId() == null : this.getWorkorderId().equals(other.getWorkorderId()))
            && (this.getWorkorderCode() == null ? other.getWorkorderCode() == null : this.getWorkorderCode().equals(other.getWorkorderCode()))
            && (this.getWorkorderName() == null ? other.getWorkorderName() == null : this.getWorkorderName().equals(other.getWorkorderName()))
            && (this.getClientOrderId() == null ? other.getClientOrderId() == null : this.getClientOrderId().equals(other.getClientOrderId()))
            && (this.getClientOrderCode() == null ? other.getClientOrderCode() == null : this.getClientOrderCode().equals(other.getClientOrderCode()))
            && (this.getOrderSource() == null ? other.getOrderSource() == null : this.getOrderSource().equals(other.getOrderSource()))
            && (this.getSourceCode() == null ? other.getSourceCode() == null : this.getSourceCode().equals(other.getSourceCode()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProductCode() == null ? other.getProductCode() == null : this.getProductCode().equals(other.getProductCode()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getProductSpc() == null ? other.getProductSpc() == null : this.getProductSpc().equals(other.getProductSpc()))
            && (this.getUnitOfMeasure() == null ? other.getUnitOfMeasure() == null : this.getUnitOfMeasure().equals(other.getUnitOfMeasure()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getQuantityProduced() == null ? other.getQuantityProduced() == null : this.getQuantityProduced().equals(other.getQuantityProduced()))
            && (this.getQuantityChanged() == null ? other.getQuantityChanged() == null : this.getQuantityChanged().equals(other.getQuantityChanged()))
            && (this.getQuantityScheduled() == null ? other.getQuantityScheduled() == null : this.getQuantityScheduled().equals(other.getQuantityScheduled()))
            && (this.getClientId() == null ? other.getClientId() == null : this.getClientId().equals(other.getClientId()))
            && (this.getClientCode() == null ? other.getClientCode() == null : this.getClientCode().equals(other.getClientCode()))
            && (this.getClientName() == null ? other.getClientName() == null : this.getClientName().equals(other.getClientName()))
            && (this.getRequestDate() == null ? other.getRequestDate() == null : this.getRequestDate().equals(other.getRequestDate()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getAncestors() == null ? other.getAncestors() == null : this.getAncestors().equals(other.getAncestors()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getAttr1() == null ? other.getAttr1() == null : this.getAttr1().equals(other.getAttr1()))
            && (this.getAttr2() == null ? other.getAttr2() == null : this.getAttr2().equals(other.getAttr2()))
            && (this.getAttr3() == null ? other.getAttr3() == null : this.getAttr3().equals(other.getAttr3()))
            && (this.getAttr4() == null ? other.getAttr4() == null : this.getAttr4().equals(other.getAttr4()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getBatchCode() == null ? other.getBatchCode() == null : this.getBatchCode().equals(other.getBatchCode()))
            && (this.getFinishDate() == null ? other.getFinishDate() == null : this.getFinishDate().equals(other.getFinishDate()))
            && (this.getWorkorderType() == null ? other.getWorkorderType() == null : this.getWorkorderType().equals(other.getWorkorderType()))
            && (this.getVendorId() == null ? other.getVendorId() == null : this.getVendorId().equals(other.getVendorId()))
            && (this.getVendorCode() == null ? other.getVendorCode() == null : this.getVendorCode().equals(other.getVendorCode()))
            && (this.getVendorName() == null ? other.getVendorName() == null : this.getVendorName().equals(other.getVendorName()))
            && (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
            && (this.getUpdateUserId() == null ? other.getUpdateUserId() == null : this.getUpdateUserId().equals(other.getUpdateUserId()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getDeleteat() == null ? other.getDeleteat() == null : this.getDeleteat().equals(other.getDeleteat()))
            && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
            && (this.get列Name() == null ? other.get列Name() == null : this.get列Name().equals(other.get列Name()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWorkorderId() == null) ? 0 : getWorkorderId().hashCode());
        result = prime * result + ((getWorkorderCode() == null) ? 0 : getWorkorderCode().hashCode());
        result = prime * result + ((getWorkorderName() == null) ? 0 : getWorkorderName().hashCode());
        result = prime * result + ((getClientOrderId() == null) ? 0 : getClientOrderId().hashCode());
        result = prime * result + ((getClientOrderCode() == null) ? 0 : getClientOrderCode().hashCode());
        result = prime * result + ((getOrderSource() == null) ? 0 : getOrderSource().hashCode());
        result = prime * result + ((getSourceCode() == null) ? 0 : getSourceCode().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProductCode() == null) ? 0 : getProductCode().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getProductSpc() == null) ? 0 : getProductSpc().hashCode());
        result = prime * result + ((getUnitOfMeasure() == null) ? 0 : getUnitOfMeasure().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getQuantityProduced() == null) ? 0 : getQuantityProduced().hashCode());
        result = prime * result + ((getQuantityChanged() == null) ? 0 : getQuantityChanged().hashCode());
        result = prime * result + ((getQuantityScheduled() == null) ? 0 : getQuantityScheduled().hashCode());
        result = prime * result + ((getClientId() == null) ? 0 : getClientId().hashCode());
        result = prime * result + ((getClientCode() == null) ? 0 : getClientCode().hashCode());
        result = prime * result + ((getClientName() == null) ? 0 : getClientName().hashCode());
        result = prime * result + ((getRequestDate() == null) ? 0 : getRequestDate().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getAncestors() == null) ? 0 : getAncestors().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getAttr1() == null) ? 0 : getAttr1().hashCode());
        result = prime * result + ((getAttr2() == null) ? 0 : getAttr2().hashCode());
        result = prime * result + ((getAttr3() == null) ? 0 : getAttr3().hashCode());
        result = prime * result + ((getAttr4() == null) ? 0 : getAttr4().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getBatchCode() == null) ? 0 : getBatchCode().hashCode());
        result = prime * result + ((getFinishDate() == null) ? 0 : getFinishDate().hashCode());
        result = prime * result + ((getWorkorderType() == null) ? 0 : getWorkorderType().hashCode());
        result = prime * result + ((getVendorId() == null) ? 0 : getVendorId().hashCode());
        result = prime * result + ((getVendorCode() == null) ? 0 : getVendorCode().hashCode());
        result = prime * result + ((getVendorName() == null) ? 0 : getVendorName().hashCode());
        result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
        result = prime * result + ((getUpdateUserId() == null) ? 0 : getUpdateUserId().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getDeleteat() == null) ? 0 : getDeleteat().hashCode());
        result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
        result = prime * result + ((get列Name() == null) ? 0 : get列Name().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", workorderId=").append(workorderId);
        sb.append(", workorderCode=").append(workorderCode);
        sb.append(", workorderName=").append(workorderName);
        sb.append(", clientOrderId=").append(clientOrderId);
        sb.append(", clientOrderCode=").append(clientOrderCode);
        sb.append(", orderSource=").append(orderSource);
        sb.append(", sourceCode=").append(sourceCode);
        sb.append(", productId=").append(productId);
        sb.append(", productCode=").append(productCode);
        sb.append(", productName=").append(productName);
        sb.append(", productSpc=").append(productSpc);
        sb.append(", unitOfMeasure=").append(unitOfMeasure);
        sb.append(", quantity=").append(quantity);
        sb.append(", quantityProduced=").append(quantityProduced);
        sb.append(", quantityChanged=").append(quantityChanged);
        sb.append(", quantityScheduled=").append(quantityScheduled);
        sb.append(", clientId=").append(clientId);
        sb.append(", clientCode=").append(clientCode);
        sb.append(", clientName=").append(clientName);
        sb.append(", requestDate=").append(requestDate);
        sb.append(", parentId=").append(parentId);
        sb.append(", ancestors=").append(ancestors);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", attr1=").append(attr1);
        sb.append(", attr2=").append(attr2);
        sb.append(", attr3=").append(attr3);
        sb.append(", attr4=").append(attr4);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", batchCode=").append(batchCode);
        sb.append(", finishDate=").append(finishDate);
        sb.append(", workorderType=").append(workorderType);
        sb.append(", vendorId=").append(vendorId);
        sb.append(", vendorCode=").append(vendorCode);
        sb.append(", vendorName=").append(vendorName);
        sb.append(", createUserId=").append(createUserId);
        sb.append(", updateUserId=").append(updateUserId);
        sb.append(", deleted=").append(deleted);
        sb.append(", deleteat=").append(deleteat);
        sb.append(", version=").append(version);
        sb.append(", 列Name=").append(列Name);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}